package com.zzy.bridge;

import com.zzy.RegisterLoginType;
import com.zzy.pojo.UserInfo;
import com.zzy.repo.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: zzy
 * @CreateTime: 2024-09-30
 * @Description: 默认实现
 * @Version: 1.0
 */
@Component
@RegisterLoginType(RegisterLoginEnum.DEFAULT)
public class RegisterLoginByDefault extends AbstractRegisterLoginFunc implements RegisterLoginFuncInterface {

    @Autowired
    private UserRepository userRepository;

    @Override
    public String login(String account, String password) {
        return super.commonLogin(account, password, userRepository);
    }

    @Override
    public String register(UserInfo userInfo) {
        return super.commonRegister(userInfo, userRepository);
    }

    @Override
    public boolean checkUserExist(String userName) {
        return super.commonCheckUserExist(userName, userRepository);
    }

    @Override
    public String login3rd(HttpServletRequest request) {
        return null;
    }
}
